import java.util.Scanner;

/*
 * 提示用户输入年月日信息，判断这一天是这一年中的第几天并打印。
 */
public class DayInYear {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        //获取输入的年月日，不判断非法数据
        System.out.println("请输入年：");
        int year  = scanner.nextInt();
        System.out.println("请输入月：");
        int month  = scanner.nextInt();
        System.out.println("请输入日：");
        int day = scanner.nextInt();

        int sum_days = 0;

        //考虑一月份，month -1
        switch (month - 1)
        {
            //case 穿透
            case 11:sum_days += 30;
            case 10:sum_days += 31;
            case 9: sum_days += 30;
            case 8: sum_days += 31;
            case 7: sum_days += 31;
            case 6: sum_days += 30;
            case 5: sum_days += 31;
            case 4: sum_days += 30;
            case 3: sum_days += 31;
            case 2: sum_days += 28;
            case 1: sum_days += 31; break;
            default:break;
        }

        //判断是否是闰年 闰年2月29天                    世纪年%400
        if ((year % 4 == 0) && (year % 100 != 0) || year % 400 == 0)
            if (month > 2)
                sum_days++;

        sum_days += day;

        // System.out.println("年：" +year+ "  月："+month+"  日：" + day);
        System.out.println(year +"年" + month + "月" +day+"日" );
        System.out.println("这是"+year+"年中的第" + sum_days+"天\n");
  
        scanner.close();

    }

}